﻿@using eBusiness.App_DAL
@model eBusiness.Models.News

@{
    ViewBag.Title = "Delete";
    Layout = "../Shared/_Layout.cshtml";
}

<h2>Delete</h2>

<h3>Are you sure you want to delete this?</h3>
<fieldset>
    <legend>News</legend>
    <table class="dashboardTable">
        <tr>
            <td style="width: 120px; padding: 10px;">
                <img src="@Model.ThumbImage" alt="image" style="width: 120px;" />
            </td>
            <td>
                <table class="dashboardTable">
                    <tr>
                        <td colspan="2">
                            <h2>@Html.DisplayFor(model => model.Title)</h2>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            created on <span>@Html.DisplayFor(model => model.CreatedDate)</span> by <span>
                                @{
                                    if (!string.IsNullOrEmpty(Model.CreatedBy.ToString()))
                                    {
                                        var usr = Membership.GetUser(Model.CreatedBy).UserName;
                                    @usr
                                    }
                                }
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Summary</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <section>
                                @Model.Details.GetLeft(500, true)
                            </section>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b>Details</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.DisplayFor(model => model.Details)
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</fieldset>
@using (Html.BeginForm()) {
    <p>
        <input type="submit" value="Delete" /> |
        @Html.ActionLink("Back to List", "Index")
    </p>
}
